package com.mallcloud.mall.app.api.entity.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.mallcloud.mall.common.core.constant.enums.app.WxPayEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

@ApiModel(value="WxPay2UnifiedOrderInfoDTO",description="微信统一下单请求参数")
@Data
public class WxPay2UnifiedOrderInfoDTO implements Serializable {
	private static final long serialVersionUID = 1L;

    @ApiModelProperty("小程序唯一标识(在微信小程序管理后台获取)")
	@JSONField(name = "appid")
    private String appId;
    
    @ApiModelProperty("商品描述")
	@JSONField(name = "body")
    private String body;

    @ApiModelProperty("设备号")
	@JSONField(name = "device_info")
    private String deviceInfo;

    @ApiModelProperty("商户号")
	@JSONField(name = "mch_id")
    private String mchId;

    @ApiModelProperty("随机字符串")
	@JSONField(name = "nonce_str")
    private String nonceStr;
    
    @ApiModelProperty("签名")
	@JSONField(name = "sign")
    private String sign;

    @ApiModelProperty("通知地址")
	@JSONField(name = "notify_url")
    private String notifyUrl;

    @ApiModelProperty("openId")
	@JSONField(name = "openid")
    private String openId;

    @NotBlank(message = "商户订单号不能为空")
    @ApiModelProperty("商户订单号")
	@JSONField(name = "out_trade_no")
    private String outTradeNo;

    @ApiModelProperty("终端IP")
	@JSONField(name = "spbill_create_ip")
    private String terminalIp;

    @ApiModelProperty("标价金额(单位为分)")
	@JSONField(name = "total_fee")
    private String totalFee;

	/**
	 * {@link WxPayEnum.TradeTypeEnum}
	 */
	@ApiModelProperty("交易类型(JSAPI -JSAPI支付 NATIVE -Native支付 APP -APP支付)")
	@JSONField(name = "trade_type")
    private String tradeType = WxPayEnum.TradeTypeEnum.JSAPI.name();
    
    @ApiModelProperty("附加数据 传了接口就签名错误!!")
    private String attach;
}